<?php

namespace common\models\credit_app_tables;

use Yii;

/**
 * This is the model class for table "{{%order_car}}".
 *
 * @property int $ot_id
 * @property int $ot_oid 单号
 * @property string $ot_car_type 车辆类型
 * @property string $ot_car_brand 品牌
 * @property string $ot_car_model 车型号
 * @property string $ot_car_fullmodel 具体车系
 * @property int $ot_car_seating 座位数
 * @property string $ot_car_pose 车型构成
 * @property string $ot_pubbrand 是否公牌
 * @property string $ot_reg_province 上牌地省份
 * @property string $ot_reg_city 上牌地市
 * @property string $ot_reg_area 上牌地区
 * @property string $ot_car_owners 行驶证车主
 * @property int $ot_loan_year 贷款年限
 * @property string $ot_loan_type 产品类型
 * @property string $ot_car_price 车价
 * @property string $ot_car_oprice 其他费用，体现某银行在超百分比时加上车价
 * @property string $ot_loan_limit 贷款额度
 * @property string $ot_loan_rate 公司费率
 * @property int $ot_bankrt_id 银行对应利率ID
 * @property string $ot_bankrt_code 银行对应利率编码
 * @property string $ot_bankrt_rate 银行利率
 * @property string $ot_calculated 计算后值
 * @property string $ot_sinocap 评估公司（未使用）
 * @property string $ot_estimate 预估价（未使用）
 * @property string $ot_assessment 评估价
 * @property string $ot_loan_remark 备注（未使用）
 * @property string $ot_cartp 补录 车辆类型
 * @property string $ot_invoice_com 补录 发票单位
 * @property string $ot_invoice_no 补录 发票号
 * @property string $ot_carmodels 补录 具体车型
 * @property string $ot_carno 补录车架号
 * @property string $ot_chassisno 补录 底盘号
 * @property string $ot_engineno 发动机号
 * @property string $ot_carcolor 补录 汽车颜色
 * @property string $ot_initialrg_time 补录 初始登记时间
 * @property string $ot_mpac 评估人
 * @property string $ot_forecast 预估价格（未使用）
 * @property string $ot_forecat_time 评估资料上传日期
 * @property string $ot_carcard_img 二手车登记证书影像
 * @property string $ot_2check_date 放款前二手车确认时间
 * @property string $ot_2check_user 放款前二手车确认人
 * @property string $ot_assess 评估价
 * @property string $ot_assess_time 评估时间
 * @property string $ot_gps_install gps安装时间
 * @property string $ot_gps_no gps序列号
 * @property string $ot_gps_status gps状态
 * @property string $ot_gps_remark gps备注
 * @property string $ot_gps_otime 补录 GRP上线时间
 * @property string $ot_status
 * @property int $ot_dateline 录入时间
 * @property int $ot_calculated_ischange 计算结果是否改变
 * @property string $ot_billing_date 开票日期
 * @property string $ot_car_platenum 车牌号
 * @property string $ot_car_register 机动车登记证书号
 * @property string $ot_carfare_img 车资照片
 * @property string $ot_getcar_img
 * @property int $ot_image_date 提交到资审时间
 * @property string $ot_image_user 提交人
 * @property string $ot_image_status 状态
 * @property string $ot_car_lock 退回时车辆信息是否锁定
 * @property string $ot_register_time 上牌登记日期
 * @property string $ot_car_use_type 用车类型
 */
class OrderCar extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%order_car}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_app');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['ot_oid', 'ot_car_type', 'ot_car_model', 'ot_car_seating', 'ot_car_pose', 'ot_pubbrand', 'ot_reg_province', 'ot_reg_city', 'ot_reg_area', 'ot_car_owners', 'ot_loan_year', 'ot_loan_type', 'ot_car_price', 'ot_loan_limit', 'ot_loan_rate', 'ot_bankrt_id', 'ot_bankrt_code', 'ot_calculated', 'ot_estimate', 'ot_assessment', 'ot_loan_remark', 'ot_cartp', 'ot_invoice_com', 'ot_invoice_no', 'ot_carmodels', 'ot_carno', 'ot_chassisno', 'ot_engineno', 'ot_carcolor', 'ot_initialrg_time', 'ot_mpac', 'ot_forecast', 'ot_assess', 'ot_assess_time', 'ot_gps_install', 'ot_gps_no', 'ot_gps_status', 'ot_gps_remark', 'ot_gps_otime', 'ot_status', 'ot_dateline', 'ot_billing_date', 'ot_car_register', 'ot_image_date', 'ot_image_user'], 'required'],
            [['ot_oid', 'ot_car_seating', 'ot_loan_year', 'ot_bankrt_id', 'ot_dateline', 'ot_calculated_ischange', 'ot_image_date'], 'integer'],
            [['ot_pubbrand', 'ot_calculated', 'ot_carcard_img', 'ot_status', 'ot_carfare_img', 'ot_getcar_img', 'ot_image_status', 'ot_car_lock'], 'string'],
            [['ot_car_price', 'ot_car_oprice', 'ot_loan_limit', 'ot_loan_rate', 'ot_bankrt_rate', 'ot_estimate', 'ot_assessment'], 'number'],
            [['ot_initialrg_time', 'ot_forecat_time', 'ot_2check_date', 'ot_assess_time', 'ot_gps_install', 'ot_gps_otime', 'ot_billing_date', 'ot_register_time'], 'safe'],
            [['ot_car_type', 'ot_car_model', 'ot_bankrt_code', 'ot_sinocap', 'ot_cartp', 'ot_mpac', 'ot_2check_user', 'ot_gps_no', 'ot_car_platenum', 'ot_car_register', 'ot_image_user'], 'string', 'max' => 50],
            [['ot_car_brand', 'ot_car_fullmodel'], 'string', 'max' => 255],
            [['ot_car_pose', 'ot_reg_province', 'ot_reg_city', 'ot_reg_area', 'ot_car_owners', 'ot_loan_type', 'ot_invoice_com', 'ot_invoice_no', 'ot_carmodels', 'ot_carno', 'ot_chassisno', 'ot_engineno', 'ot_forecast', 'ot_assess'], 'string', 'max' => 30],
            [['ot_loan_remark', 'ot_gps_remark'], 'string', 'max' => 200],
            [['ot_carcolor', 'ot_car_use_type'], 'string', 'max' => 20],
            [['ot_gps_status'], 'string', 'max' => 10],
            [['ot_oid'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ot_id' => Yii::t('app', 'Ot ID'),
            'ot_oid' => Yii::t('app', '单号'),
            'ot_car_type' => Yii::t('app', '车辆类型'),
            'ot_car_brand' => Yii::t('app', '品牌'),
            'ot_car_model' => Yii::t('app', '车型号'),
            'ot_car_fullmodel' => Yii::t('app', '具体车系'),
            'ot_car_seating' => Yii::t('app', '座位数'),
            'ot_car_pose' => Yii::t('app', '车型构成'),
            'ot_pubbrand' => Yii::t('app', '是否公牌'),
            'ot_reg_province' => Yii::t('app', '上牌地省份'),
            'ot_reg_city' => Yii::t('app', '上牌地市'),
            'ot_reg_area' => Yii::t('app', '上牌地区'),
            'ot_car_owners' => Yii::t('app', '行驶证车主'),
            'ot_loan_year' => Yii::t('app', '贷款年限'),
            'ot_loan_type' => Yii::t('app', '产品类型'),
            'ot_car_price' => Yii::t('app', '车价'),
            'ot_car_oprice' => Yii::t('app', '其他费用，体现某银行在超百分比时加上车价'),
            'ot_loan_limit' => Yii::t('app', '贷款额度'),
            'ot_loan_rate' => Yii::t('app', '公司费率'),
            'ot_bankrt_id' => Yii::t('app', '银行对应利率ID'),
            'ot_bankrt_code' => Yii::t('app', '银行对应利率编码'),
            'ot_bankrt_rate' => Yii::t('app', '银行利率'),
            'ot_calculated' => Yii::t('app', '计算后值'),
            'ot_sinocap' => Yii::t('app', '评估公司（未使用）'),
            'ot_estimate' => Yii::t('app', '预估价（未使用）'),
            'ot_assessment' => Yii::t('app', '评估价'),
            'ot_loan_remark' => Yii::t('app', '备注（未使用）'),
            'ot_cartp' => Yii::t('app', '补录 车辆类型'),
            'ot_invoice_com' => Yii::t('app', '补录 发票单位'),
            'ot_invoice_no' => Yii::t('app', '补录 发票号'),
            'ot_carmodels' => Yii::t('app', '补录 具体车型'),
            'ot_carno' => Yii::t('app', '补录车架号'),
            'ot_chassisno' => Yii::t('app', '补录 底盘号'),
            'ot_engineno' => Yii::t('app', '发动机号'),
            'ot_carcolor' => Yii::t('app', '补录 汽车颜色'),
            'ot_initialrg_time' => Yii::t('app', '补录 初始登记时间'),
            'ot_mpac' => Yii::t('app', '评估人'),
            'ot_forecast' => Yii::t('app', '预估价格（未使用）'),
            'ot_forecat_time' => Yii::t('app', '评估资料上传日期'),
            'ot_carcard_img' => Yii::t('app', '二手车登记证书影像'),
            'ot_2check_date' => Yii::t('app', '放款前二手车确认时间'),
            'ot_2check_user' => Yii::t('app', '放款前二手车确认人'),
            'ot_assess' => Yii::t('app', '评估价'),
            'ot_assess_time' => Yii::t('app', '评估时间'),
            'ot_gps_install' => Yii::t('app', 'gps安装时间'),
            'ot_gps_no' => Yii::t('app', 'gps序列号'),
            'ot_gps_status' => Yii::t('app', 'gps状态'),
            'ot_gps_remark' => Yii::t('app', 'gps备注'),
            'ot_gps_otime' => Yii::t('app', '补录 GRP上线时间'),
            'ot_status' => Yii::t('app', 'Ot Status'),
            'ot_dateline' => Yii::t('app', '录入时间'),
            'ot_calculated_ischange' => Yii::t('app', '计算结果是否改变'),
            'ot_billing_date' => Yii::t('app', '开票日期'),
            'ot_car_platenum' => Yii::t('app', '车牌号'),
            'ot_car_register' => Yii::t('app', '机动车登记证书号'),
            'ot_carfare_img' => Yii::t('app', '车资照片'),
            'ot_getcar_img' => Yii::t('app', 'Ot Getcar Img'),
            'ot_image_date' => Yii::t('app', '提交到资审时间'),
            'ot_image_user' => Yii::t('app', '提交人'),
            'ot_image_status' => Yii::t('app', '状态'),
            'ot_car_lock' => Yii::t('app', '退回时车辆信息是否锁定'),
            'ot_register_time' => Yii::t('app', '上牌登记日期'),
            'ot_car_use_type' => Yii::t('app', '用车类型'),
        ];
    }
}
